import React, { Component } from 'react';
import Taro from '@tarojs/taro';
import { View } from '@tarojs/components'

export default class Index extends Component {
  UNSAFE_componentWillMount() {
        const params = Taro.getCurrentInstance().router.params
        if(Object.keys(params).length > 0){
            let text = '?'
            for(const key in params){
                text += `${key}=${params[key]}&`
            }
            Taro.switchTab({url: '/pages/my/index/index' + text})
        } else {
            Taro.switchTab({url: '/pages/my/index/index'})
        }
    }
    render () {
        return (
      <View />
    )
    }
}
